package CreateThread;


import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "c.TestStartAndRun")
public class TestStartAndRun {
    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            log.debug("running");
        });
        Thread thread1 = new Thread(){
            @Override
            public void run() {
                log.debug("running1");
            }
        };
        System.out.println("thread:"+thread.getState());
        thread.run();
        System.out.println("thread:"+thread.getState());


        System.out.println("thread1:"+thread1.getState());
        thread1.setName("thread1");
        thread1.start();
        System.out.println("thread1:"+thread1.getState());
    }
}
